package com.cloud.async.business.core;

import com.cloud.async.business.body.BusinessResult;

import java.util.function.Consumer;
import java.util.function.Supplier;

/**
 * @author february@chengr
 * @date 2025/7/25
 * @description Business
 * @className Business
 */
public interface Business {
    /**
     * asyncBusiness
     * @param rsp
     * @return
     */
    <T> BusinessResult doBusiness(Supplier<T> task, Class<T> rsp);
    /**
     * 自定义任务ID
     * @param task
     * @param taskId
     * @param rsp
     * @param <T>
     * @return
     */
    <T> BusinessResult doBusiness(Supplier<T> task, String taskId, Class<T> rsp);
}